# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.t'

#########################

# change 'tests => 1' to 'tests => last_test_to_print';

use Test::More tests => 3;
BEGIN { use_ok('WWW::NikePlus') }

#########################

# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.

use Net::Netrc;

my $mach = Net::Netrc->lookup('nikeplus');

my $np = WWW::NikePlus->new(
  login    => $mach->login(),
  password => $mach->password(),
);

is(ref($np), 'WWW::NikePlus', 'Login Successful');

my @goals = $np->get_goal_list(completed => 1);
my $test = 0;

foreach my $g (@goals) {
  $test++ if( $g->isComplete() );
}
is($test, scalar(@goals), 'Complete Flag');


#  next unless( $g->getType() eq 'runFurther' );
#  quick('complete',  $g->isComplete());
#  quick('completed', $g->getCompletedTime());
#  quick('type',      $g->getType());
#  quick('start',     $g->getStartTime());
#  quick('end',       $g->getEndTime());
#  quick('progress',  $g->getProgress());
#  quick('finish',    $g->getGoal());

#  my $sched = $g->getSchedule();
#  foreach my $day (keys %{$sched}){
#    quick($day => $sched->{$day});
#  }
#}
